package com.iweb.service.impl;

import com.iweb.dao.ProductDao;
import com.iweb.dao.impl.ProductDaoImp;
import com.iweb.entity.Product;
import com.iweb.service.ProductService;

import java.util.List;

/**
 * @author jay
 * @date 2021/9/13
 * @description
 */
public class ProductServiceImpl implements ProductService {
    private ProductDao productDao = new ProductDaoImp();

    @Override
    public Product findById(Integer id) throws Exception {
        return this.productDao.selectById(id);
    }

    @Override
    public void add(Product product) throws Exception {
        this.productDao.insert(product);
    }

    @Override
    public List<Product> findListByTypeOne(Integer typeOneId, int rows) throws Exception {
        return this.productDao.selectListByTypeOne(typeOneId, rows);
    }
}
